Rav Yosef makes a statement that is somewhat meduyak in the mishna, that one can only make an eiruv techumin for a d'var mitzvah. Both the Rambam and Rashba (avodas hakodesh) pasken like Rav Yosef that one can only make an eiruv for a d'var hareshus. However, the Rambam (6:6) holds that although one is only allowed to make an eiruv for a d'var mitzvah, if they were to be me'areiv for a d'var ha'rshus it would be binding. The Rashba disagrees and holds that even bidieved, if done for a dvar harshus, it is not binding. The Rashba then qualifies and says that this is only if he were to be me'areiv with bread, but one who is me'areiv b'raglav by being at the edge of the techum when shabbos begins, that can be done even for a d'var ha'rshus. The Gaon Yaacov rejects the approach of the Rashba (and Rabbeinu Yehonasan) who say that one can be me'areiv b'raglav for a d'var ha'rshus even lichatchila. The rationale to be more lenient by being me'areiv b'raglav is because they consider that to be the "ikar eiruv". Therefore, it should follow that according to R. Meir 49b who says that ikar eiruv is with bread, one can be me'areiv with bread even for d'var harshus, which is against our mishnah. Therefore, the Gaon Yaakov concludes that there is not distinction between being me'areiv b'raglav and using bread, it can only be done for a d'var mitzvah.
There is another major machlokes Rishonim. Rashi comments on the statement of only being me'areiv for d'var ha'rshus that it is not merely a din in what one is making the eiruv for. Rather, Rashi writes that one cannot use an eiruv for anything other than a d'var mitzvah. Rashi implies that even if one made an eiruv for a d'var mitzvah, they cannot use the eiruv once it is made for a d'var harshus. The Tur (415) disagrees and writes that once the eiruv is made for a d'var mitzvah, it can be used for a d'var ha'rshus. The machlokes between Rashi and the Tur is whether the din of אין מערבין אלא לדבר מצוה is a din in the making of an eiruv (Tur) or the use of an eiruv (Rashi). The Gaon Yaacov explains that Rashi must hold like the Rashba that if one would make an eiruv for a d'var harshus it wouldn't be binding even bidieved, because if making an eiruv for d'var ha'rshus works bidieved, when it is done for a dvar mitzvah it should certainly be usable for a d'var ha'rshus since it is already bidieved. In other words, if we are going to say like the Rambam that bidieved it works if done l'dvar ha'rshus, we would surely permit one to use the eiruv l'dvar ha'rshus when it was done for a d'var mitzvah.
Tosafos (d.h. kattan) asks that since we only allow an eiruv l'dvar ha'rshus, how can we talk about using the eiruv for a young child, what mitzvah can be possibly do? Tosafos answers: 1. the child is so connected to the mother that she can't go without him, therefore bringing the child with her is part of the d'var mitzvah. 2. since there is a mitzvah of chinuch to train a child to do mitzvos, it qualifies as a d'var mitzvah when the child is being taken to do nichum aveilim or another mitzvah.
Had Tosafos held like the Tur that the din of an eiruv l'dvar mitzvah was only in the making of an eiruv, Tosafos should have no question. Once the mother makes an eiruv l'dvar mitzvah, it is usable even for a d'var ha'rshus, therefore there is no need to associate a mitzvah with the child going. The fact that Tosafos needs to associate a mitzvah with the child, or make the mothers ability to do the mitzvah dependent on the child being able to go, implies that they hold like rashi; even after an eiruv is made l'dvar mitzvah, it cannot be used for a d'var ha'rshus, only for a d'var mitzvah.
The Rama (415) paskens like the Tur, and the Shulchan Aruch (in line with the Rama) paskens like the Rambam. Therefore, they hold that if one made an eiruv l'dvar mitzvah, they can travel for a d'var ha'rshus, AND that if one made an eiruv for a d'var ha'rshus, it is binding bidieved. The Sha'ar Hatziyun (11) explains that by the Shulchan Aruch paskening like the Rambam that even when done for a d'var r'shus it works bidieved, he is automatically incorporating the opinion of the Tur that certainly when done for a d'var mitzvah it can be used for a d'var ha'rshus. It would seem based on this that the opinion of the Tur that when done l'dvar mitzvah it can be used for d'var ha'rshus would disagree with the Rambam and hold that if done originally for d'var ha'rshus, it would not work (otherwise the Tur should say a bigger chiddush). Therefore, it should follow that by the Rama citing the Tur, he is rejecting the Rambam and would hold that if one made an eiruv for a d'var ha'rshus it wouldn't even be binding bidieved. However, it is possible that the Tur and Rama really agree with the Rambam, and they are coming to say that one may lichatchila make an eiruv when they know that they will need it both for a d'var mitzvah and a d'var ha'rshus. v'dok!